﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Radar;
using Radar.Navigation;

namespace Radar.Test
{
    public class Common
    {

        static private IEnumerable<NavZoneDefinition> CreateZones()
        {
            yield return new NavZoneDefinition(0, 0, 20, 20);
            yield return new NavZoneDefinition(20, 0, 60, 50);
            yield return new NavZoneDefinition(60, 0, 80, 30);
            yield return new NavZoneDefinition(10, 20, 20, 30);
            yield return new NavZoneDefinition(-10, 30, 20, 40);
        }

        static internal NavMeshDefinition CreateNavMeshDefinitionMock()
        {
            NavMeshDefinition definition = new NavMeshDefinition();
            definition.Zones = CreateZones().ToList();
            return definition;
        }

        static internal MapDefinition CreateMapDefinitionMock()
        {
            MapDefinition map = new MapDefinition();
            map.NavMesh = CreateNavMeshDefinitionMock();
            map.Grid.Width = 3;
            map.Grid.Height = 2;
            map.Width = 80;
            map.Height = 50;
            return map;
        }

        static internal NavMesh CreateNavMeshMock()
        {
            return NavMeshFactory.Instance.CreateNavMesh(CreateMapDefinitionMock().NavMesh, CreateMapDefinitionMock().Grid);
        }

    }
}
